<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <!-- 组件基础 -->
    <div id="components-demo">
        <btn-counter></btn-counter>
        <btn-counter></btn-counter>
        <btn-counter></btn-counter>
        <btn-counter></btn-counter>
        <btn-counter></btn-counter>
        <btn-counter></btn-counter>
        <blog-ctn title="QAQ"></blog-ctn>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script> -->
</body>

<script>
// 注意：1.组件需要放在最上面 2.data必须是一个函数
    Vue.component('btn-counter', {
        data: function () {
            return {
                count: 0
            }
        },
        template: '<button @click="count++">{{ count }}</button>'
    });
    
    Vue.component('blog-ctn',{
        props:['content'],
        template:`
        <h1>{{content}}</h1>
        `
    })
    
    new Vue({
        el: '#components-demo'
    })
 // 2. v-model的原型为 <input v-bind:
                        //   v-on:
</script>

</html>